﻿using System.Threading.Tasks;
using System.Web.Mvc;

using NJ.Service.RoleMenu;
using NJ.Web.Models;

namespace NJ.Web.Controllers
{
    public class HomeController : Controller
    {
        private readonly IRoleMenuService roleMenuService;
        public HomeController(IRoleMenuService _roleMenuService)
        {
            roleMenuService = _roleMenuService;
        }
        public async Task<ActionResult> Index()
        {
            var menuDtos = await roleMenuService.GetHomeMenuTreeAsync(CurUser.Model.RoleId);
            return View(menuDtos);
        }
    }
}